/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gameElements.shapes;

import constants.Constants;
import gameElements.Cell;
import java.awt.Color;
import java.awt.Graphics;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Alexandra
 */
public class Shape {

    public void rotate() {
    }
    public int[][] area = new int[Constants.height][Constants.width];
    long figure;

    public void drawShape(Graphics ctx) {
        for (int i = 0; i < area.length; i++) {
            for (int j = 0; j < area.length; j++) {
                System.out.println(Constants.getDIMENSIONx() + " : "+Constants.getDIMENSIONx()/2 +" : "+i*20);
                if (area[i][j] == 1) {
                    Cell cell = new Cell(Constants.getDIMENSIONx()*5  + j*10, Constants.getDIMENSIONy()+  i*10);
                       ctx.setColor(Color.red);
                    cell.ondrawfill(ctx);
                       ctx.setColor(Color.BLACK);
                    
                }
            }
        }
    }
    
    public void fall (Graphics g){
        int i=0;
        Thread th = new Thread();
        while (i<Constants.getDIMENSIONy()){
            try {
                th.sleep(100);
            } catch (InterruptedException ex) {
                Logger.getLogger(Shape.class.getName()).log(Level.SEVERE, null, ex);
            }
            this.drawShape(g);
            i++;
        }
    }
}
